package com.itcat.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcat.api.mysql.SmsHomeRecommendSubjectApi;
import com.itcat.mysql.pojo.SmsHomeRecommendSubject;
import com.itcat.service.SmsHomeRecommendSubjectService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SmsHomeRecommendSubjectServiceImpl implements SmsHomeRecommendSubjectService {
    @DubboReference
    private SmsHomeRecommendSubjectApi smsHomeRecommendSubjectApi;


    //分页查询推荐品牌
    @Override
    public Page<SmsHomeRecommendSubject> list(Integer pageNum, Integer pageSize, String subjectName, Integer recommendStatus) {
        Page<SmsHomeRecommendSubject> subjectPage= smsHomeRecommendSubjectApi.list(pageNum,pageSize,subjectName,recommendStatus);

        return subjectPage;
    }

    //添加首页推荐品牌
    @Override
    public void create(List<SmsHomeRecommendSubject> subjects) {
        smsHomeRecommendSubjectApi.create(subjects);
    }

    //修改专题推荐排序
    @Override
    public void updateSort(Integer id, Integer sort) {
        smsHomeRecommendSubjectApi.updateSort(id,sort);
    }

    //批量修改推荐状态
    @Override
    public void updateRecommendStatus(List<Integer> ids, Integer recommendStatus) {
        smsHomeRecommendSubjectApi.updateRecommendStatus(ids,recommendStatus);
    }

    //批量删除专题推荐
    @Override
    public void delete(List<Integer> ids) {
        smsHomeRecommendSubjectApi.delete(ids);
    }
}
